package cn.iocoder.yudao.module.trade.service.giftcard;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.module.pay.controller.admin.order.vo.PayOrderSubmitRespVO;
import cn.iocoder.yudao.module.trade.controller.admin.giftcard.vo.CardPageReqVO;
import cn.iocoder.yudao.module.trade.controller.admin.giftcard.vo.CardSaveReqVO;
import cn.iocoder.yudao.module.trade.controller.app.giftcard.vo.*;
import cn.iocoder.yudao.module.trade.dal.dataobject.giftcard.GiftCardDO;
import com.alibaba.fastjson.JSONObject;
import jakarta.validation.Valid;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface GiftCardService {

    AppGiftCardMemberVO queryMemberInfoByOpenId(String openid);

    PayOrderSubmitRespVO notGiftCardOrder(AppGiftCardNotPayVO appGiftCardNotPayVO);

    PayOrderSubmitRespVO createGiftCardOrder(AppCreateGiftCardReqVO appCreateGiftCardReqVO);

    JSONObject detailGiftCardByCardId(Long cardId);

    List<AppGiftCardUseListVO> queryGiftCardByStatus(Integer status, String openId);

    Integer receiveGiftCard(Long cardId, String nickName, String avatar);

    Integer revokeGive(Long cardId);

    Integer lisy(Long cardId,String openId);

    Integer giveGiftCard(Long cardId, String openId, String nickName, String avatar);

    AppSomeVO giftCardReceiveGive(Long cardId);

    Integer useGiveCard(Long cardId, Long addressId, String openId);


    /**
     * 创建礼品卡
     *
     * @param createReqVO 创建信息
     * @return 编号
     */
    Long createCard(@Valid CardSaveReqVO createReqVO);

    /**
     * 更新礼品卡
     *
     * @param updateReqVO 更新信息
     */
    void updateCard(@Valid CardSaveReqVO updateReqVO);

    /**
     * 删除礼品卡
     *
     * @param id 编号
     */
    void deleteCard(Long id);

    /**
     * 获得礼品卡
     *
     * @param id 编号
     * @return 礼品卡
     */
    GiftCardDO getCard(Long id);

    /**
     * 获得礼品卡分页
     *
     * @param pageReqVO 分页查询
     * @return 礼品卡分页
     */
    PageResult<GiftCardDO> getCardPage(CardPageReqVO pageReqVO);

    AppSomeVO queryAppSomeVO(@Param("giftCardId") Long giftCardId);

    void updateByTradeOrderId(Integer giftCardStatus, Long tradeOrderId, Integer changeType);

    boolean queryGiftCardByTradeOrderId(Long tradeOrderId);
}
